﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Data;

namespace T3task1
{
    class Program
    {
        static void Main(string[] args)
        {
            
            string sql = "select * from games";
            SqlDataReader dr = DBHelper.Select(sql);
            Console.WriteLine("游戏名字\t游戏价钱\t游戏库存");
            while (dr.Read())
            {
                Console.WriteLine("{0}\t{1}\t\t{2}", dr[1], dr[2], dr[3]);
            }
            string sql3 = "select sum(PriceGame*stockGame) as 总价格 from games";
            Console.WriteLine("游戏总金额：{0}元", DBHelper.ExecuuteScalar(sql));
        }
    }
}
